home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / CommResources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  4.7 KB  |  205 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CommResources.h
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1988-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __COMMRESOURCES__
  19. #define __COMMRESOURCES__
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. #ifndef __CONDITIONALMACROS__
  25. #include <ConditionalMacros.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.                                                                 /*    tool classes (also the tool file types)    */
  53.     classCM                        = FOUR_CHAR_CODE('cbnd'),
  54.     classFT                        = FOUR_CHAR_CODE('fbnd'),
  55.     classTM                        = FOUR_CHAR_CODE('tbnd')
  56. };
  57.  
  58.  
  59. enum {
  60.                                                                 /*    version of the Comm Resource Manager    */
  61.     curCRMVersion                = 2,                            /* constants general to the use of the Communications Resource Manager */
  62.     crmType                        = 9,                            /* queue type    */
  63.     crmRecVersion                = 1,                            /* version of queue structure */
  64.                                                                 /*    error codes */
  65.     crmGenericError                = -1,
  66.     crmNoErr                    = 0
  67. };
  68.  
  69. /* data structures general to the use of the Communications Resource Manager */
  70. typedef OSErr                             CRMErr;
  71. struct CRMRec {
  72.     QElemPtr                         qLink;                        /*reserved*/
  73.     short                             qType;                        /*queue type -- ORD(crmType) = 9*/
  74.     short                             crmVersion;                    /*version of queue element data structure*/
  75.     long                             crmPrivate;                    /*reserved*/
  76.     short                             crmReserved;                /*reserved*/
  77.     long                             crmDeviceType;                /*type of device, assigned by DTS*/
  78.     long                             crmDeviceID;                /*device ID; assigned when CRMInstall is called*/
  79.     long                             crmAttributes;                /*pointer to attribute block*/
  80.     long                             crmStatus;                    /*status variable - device specific*/
  81.     long                             crmRefCon;                    /*for device private use*/
  82. };
  83. typedef struct CRMRec CRMRec;
  84.  
  85. typedef CRMRec *                        CRMRecPtr;
  86. EXTERN_API( CRMErr )
  87. InitCRM                            (void);
  88.  
  89. EXTERN_API( QHdrPtr )
  90. CRMGetHeader                    (void);
  91.  
  92. EXTERN_API( void )
  93. CRMInstall                        (CRMRecPtr                 crmReqPtr);
  94.  
  95. EXTERN_API( OSErr )
  96. CRMRemove                        (CRMRecPtr                 crmReqPtr);
  97.  
  98. EXTERN_API( CRMRecPtr )
  99. CRMSearch                        (CRMRecPtr                 crmReqPtr);
  100.  
  101. EXTERN_API( short )
  102. CRMGetCRMVersion                (void);
  103.  
  104. EXTERN_API( Handle )
  105. CRMGetResource                    (ResType                 theType,
  106.                                  short                     theID);
  107.  
  108. EXTERN_API( Handle )
  109. CRMGet1Resource                    (ResType                 theType,
  110.                                  short                     theID);
  111.  
  112. EXTERN_API( Handle )
  113. CRMGetIndResource                (ResType                 theType,
  114.                                  short                     index);
  115.  
  116. EXTERN_API( Handle )
  117. CRMGet1IndResource                (ResType                 theType,
  118.                                  short                     index);
  119.  
  120. EXTERN_API( Handle )
  121. CRMGetNamedResource                (ResType                 theType,
  122.                                  ConstStr255Param         name);
  123.  
  124. EXTERN_API( Handle )
  125. CRMGet1NamedResource            (ResType                 theType,
  126.                                  ConstStr255Param         name);
  127.  
  128. EXTERN_API( void )
  129. CRMReleaseResource                (Handle                 theHandle);
  130.  
  131. EXTERN_API( Handle )
  132. CRMGetToolResource                (short                     procID,
  133.                                  ResType                 theType,
  134.                                  short                     theID);
  135.  
  136. EXTERN_API( Handle )
  137. CRMGetToolNamedResource            (short                     procID,
  138.                                  ResType                 theType,
  139.                                  ConstStr255Param         name);
  140.  
  141. EXTERN_API( void )
  142. CRMReleaseToolResource            (short                     procID,
  143.                                  Handle                 theHandle);
  144.  
  145. EXTERN_API( long )
  146. CRMGetIndex                        (Handle                 theHandle);
  147.  
  148. EXTERN_API( short )
  149. CRMLocalToRealID                (ResType                 bundleType,
  150.                                  short                     toolID,
  151.                                  ResType                 theType,
  152.                                  short                     localID);
  153.  
  154. EXTERN_API( short )
  155. CRMRealToLocalID                (ResType                 bundleType,
  156.                                  short                     toolID,
  157.                                  ResType                 theType,
  158.                                  short                     realID);
  159.  
  160. EXTERN_API( OSErr )
  161. CRMGetIndToolName                (OSType                 bundleType,
  162.                                  short                     index,
  163.                                  Str255                 toolName);
  164.  
  165. EXTERN_API( OSErr )
  166. CRMFindCommunications            (short *                vRefNum,
  167.                                  long *                    dirID);
  168.  
  169. EXTERN_API( Boolean )
  170. CRMIsDriverOpen                    (ConstStr255Param         driverName);
  171.  
  172. EXTERN_API( CRMErr )
  173. CRMParseCAPSResource            (Handle                 theHandle,
  174.                                  ResType                 selector,
  175.                                  unsigned long *        value);
  176.  
  177. EXTERN_API( OSErr )
  178. CRMReserveRF                    (short                     refNum);
  179.  
  180. EXTERN_API( OSErr )
  181. CRMReleaseRF                    (short                     refNum);
  182.  
  183.  
  184.  
  185. #if PRAGMA_STRUCT_ALIGN
  186.     #pragma options align=reset
  187. #elif PRAGMA_STRUCT_PACKPUSH
  188.     #pragma pack(pop)
  189. #elif PRAGMA_STRUCT_PACK
  190.     #pragma pack()
  191. #endif
  192.  
  193. #ifdef PRAGMA_IMPORT_OFF
  194. #pragma import off
  195. #elif PRAGMA_IMPORT
  196. #pragma import reset
  197. #endif
  198.  
  199. #ifdef __cplusplus
  200. }
  201. #endif
  202.  
  203. #endif /* __COMMRESOURCES__ */
  204.  
  205.